<!DOCTYPE html>
<html lang="zh-CN" ng-app="tools">
<head>
	<title>Search</title>
	<link rel="stylesheet" type="text/css" href="/static/lib/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/static/css/index.css">
</head>
<body>
	<div ng-controller="SearchController">
		<form class="form-inline center-block" style="width:600px">
			<div class="dropdown form-group">
				<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">
					<span ng-bind="prefix"></span>
			    	<span class="caret"></span>
			  	</button>
			  	<ul class="dropdown-menu">
			    	<li ng-repeat="prefix in prefixes">
			    		<a href="#" ng-bind="prefix" ng-click="setPrefix(prefix)"></a>
			    	</li>
			  	</ul>
			</div>
			<div class="form-group">
				<label class="sr-only" for="tvId">tvId</label>
			    <input class="form-control" id="tvId" placeholder="SN/Mac" ng-model="tvId"/>
			</div>
			<div class="form-group">
				<label class="sr-only" for="userId">userId</label>
			    <input class="form-control" id="userId" placeholder="userID" ng-model="userId"/>
			</div>
			<button type="button" class="btn btn-default" ng-click="search(tvId,userId)">查找</button>
		</form>
		<div class="alert alert-danger center-block" style="max-width:700px" ng-if="isQueryFail">
			没有查询到该字段的数据，请检查该字段并重新输入
		</div>
		<div ng-if="isTableExists">
			<table class="table table-hover table-responsive table-condensed">
				<thead><tr><th ng-repeat="title in titles" ng-bind="title"></th></tr></thead>
				<tbody>
					<tr ng-repeat="item in items">
						<td ng-repeat="value in item track by $index" ng-bind="value"></td>
					</tr>
				</tbody>
			</table>
		</div>
		<div ng-if="isMonthlyExists" class="table">
			<table class="table table-hover table-responsive table-condensed">
				<caption>包月</caption>
				<thead><tr><th ng-repeat="title in orderTitles" ng-bind="title"></th></tr></thead>
				<tbody>
					<tr ng-repeat="item in monthlyItems">
						<td ng-repeat="value in item track by $index" ng-bind="value"></td>
					</tr>
				</tbody>
			</table>
		</div>
		<div ng-if="isPpvExists" class="table">
			<table class="table table-hover table-responsive table-condensed">
				<caption>PPV</caption>
				<thead><tr><th ng-repeat="title in orderTitles" ng-bind="title"></th></tr></thead>
				<tbody>
					<tr ng-repeat="item in ppvItems">
						<td ng-repeat="value in item track by $index" ng-bind="value"></td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	<script src="/static/lib/js/jquery-1.12.3.min.js"></script>
	<script src="/static/lib/js/angular.min.js"></script>
	<script src="/static/lib/js/bootstrap.min.js"></script>
	<script src="/static/js/controllers.js"></script>
	<script src="/static/index.js"></script>
</body>
</html>